<?php

class HtmlPrinter
{
	public $tabs;
	
	public function __construct()
	{
		$this->tabs = "";
	}
	
	public function pOpen($str)
	{
		$this->p($str);
		$this->tabs .= "\t";
	}
	
	public function pClose($str)
	{
		$this->tabs = substr($this->tabs, 0, -1);
		$this->p($str);
	}
	
	public function p($str)
	{
		echo $this->tabs.$str.PHP_EOL;
	}
}

?>